package com.weitu.accidentEvent.accident.service.impl;

import com.weitu.accidentEvent.accident.mapper.AccidentMonthReportMapper;
import com.weitu.accidentEvent.accident.service.AccidentMonthReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by fanyuting on 2017/6/8 0008.
 */
@Service
public class AccidentMonthReportServiceImpl implements AccidentMonthReportService {
    @Autowired
    private AccidentMonthReportMapper accidentMonthReportMapper;

    @Override
    public List<Map<String, Object>> queryMonthReport(Map<String, Object> map) {
        return this.accidentMonthReportMapper.queryMonthReport(map);
    }

    @Override
    public boolean verifyMonthReport(Map<String, Object> map) {
        int result = this.accidentMonthReportMapper.verifyMonthReport(map);
        if (result > 0) {
            return false;
        }
        return true;
    }

    @Override
    public boolean addInfo(Map<String, Object> map) {
        int result = this.accidentMonthReportMapper.insertInfo(map);
        if (result < 1) {
            return false;
        }
        return true;
    }

    @Override
    public Map<String, Object> queryInfoById(String id) {
        return this.accidentMonthReportMapper.queryInfoById(id);
    }

    @Override
    public boolean editAppState(String id, String appState) {
        int result = this.accidentMonthReportMapper.updateAppState(id, appState);
        if (result < 1) {
            return false;
        }
        return true;
    }
}
